import 'dart:convert';
import 'T.dart';
import 'user_config/data.dart';

/// 用户配置
class UserConfig {
  int? code;
  Data? data;

  UserConfig({this.code, this.data});

  @override
  String toString() => 'UserConfig(code: $code, data: $data)';

  factory UserConfig.fromCode1DataSexListNameKey0NameKey1NameKey2MarryListNameKey0NameKey1WorkListNameKey0NameKey1NameKey2NameKey3NameKey4NameKey5NameKey6NameKey7NameKey8NameKey9NameKey10NameKey11NameKey12NameKey13NameKey14NameKey15NameKey16NameKey17NameKey18NameKey19NameKey20NameKey21NameKey22NameKey23NameKey24NameKey25NameKey26NameKey27NameKey28ProfessionListNameKey0NameKey1NameItKey2NameKey3NameKey4NameKey5NameKey6NameKey7NameKey8NameKey9NameKey10NameKey11NameKey12NameKey13NameKey14NameKey15NameKey16NameKey17NameKey18NameKey19NameKey20NameKey21NameKey22NameKey23NameKey24NameKey25NameKey26NameKey27MoneyListNameKey0Name03WKey1Name46WKey2Name710WKey3Name1020WKey4Name2030WKey5Name3050WKey6Name50100WKey7Name100WKey8EduListNameKey0NameKey1NameKey2NameKey3NameKey4NameKey5NameKey6NameKey7StuListNameKey0NameKey1NameKey2(
      Map<String, dynamic> data) {
    return UserConfig(
      code: data['code'] as int?,
      data: data['data'] == null
          ? null
          : Data
              .fromCode1DataSexListNameKey0NameKey1NameKey2MarryListNameKey0NameKey1WorkListNameKey0NameKey1NameKey2NameKey3NameKey4NameKey5NameKey6NameKey7NameKey8NameKey9NameKey10NameKey11NameKey12NameKey13NameKey14NameKey15NameKey16NameKey17NameKey18NameKey19NameKey20NameKey21NameKey22NameKey23NameKey24NameKey25NameKey26NameKey27NameKey28ProfessionListNameKey0NameKey1NameItKey2NameKey3NameKey4NameKey5NameKey6NameKey7NameKey8NameKey9NameKey10NameKey11NameKey12NameKey13NameKey14NameKey15NameKey16NameKey17NameKey18NameKey19NameKey20NameKey21NameKey22NameKey23NameKey24NameKey25NameKey26NameKey27MoneyListNameKey0Name03WKey1Name46WKey2Name710WKey3Name1020WKey4Name2030WKey5Name3050WKey6Name50100WKey7Name100WKey8EduListNameKey0NameKey1NameKey2NameKey3NameKey4NameKey5NameKey6NameKey7StuListNameKey0NameKey1NameKey2(
                  data['data'] as Map<String, dynamic>),
    );
  }

  Map<String, dynamic>
      toCode1DataSexListNameKey0NameKey1NameKey2MarryListNameKey0NameKey1WorkListNameKey0NameKey1NameKey2NameKey3NameKey4NameKey5NameKey6NameKey7NameKey8NameKey9NameKey10NameKey11NameKey12NameKey13NameKey14NameKey15NameKey16NameKey17NameKey18NameKey19NameKey20NameKey21NameKey22NameKey23NameKey24NameKey25NameKey26NameKey27NameKey28ProfessionListNameKey0NameKey1NameItKey2NameKey3NameKey4NameKey5NameKey6NameKey7NameKey8NameKey9NameKey10NameKey11NameKey12NameKey13NameKey14NameKey15NameKey16NameKey17NameKey18NameKey19NameKey20NameKey21NameKey22NameKey23NameKey24NameKey25NameKey26NameKey27MoneyListNameKey0Name03WKey1Name46WKey2Name710WKey3Name1020WKey4Name2030WKey5Name3050WKey6Name50100WKey7Name100WKey8EduListNameKey0NameKey1NameKey2NameKey3NameKey4NameKey5NameKey6NameKey7StuListNameKey0NameKey1NameKey2() {
    return {
      'code': code,
      'data': data
          ?.toCode1DataSexListNameKey0NameKey1NameKey2MarryListNameKey0NameKey1WorkListNameKey0NameKey1NameKey2NameKey3NameKey4NameKey5NameKey6NameKey7NameKey8NameKey9NameKey10NameKey11NameKey12NameKey13NameKey14NameKey15NameKey16NameKey17NameKey18NameKey19NameKey20NameKey21NameKey22NameKey23NameKey24NameKey25NameKey26NameKey27NameKey28ProfessionListNameKey0NameKey1NameItKey2NameKey3NameKey4NameKey5NameKey6NameKey7NameKey8NameKey9NameKey10NameKey11NameKey12NameKey13NameKey14NameKey15NameKey16NameKey17NameKey18NameKey19NameKey20NameKey21NameKey22NameKey23NameKey24NameKey25NameKey26NameKey27MoneyListNameKey0Name03WKey1Name46WKey2Name710WKey3Name1020WKey4Name2030WKey5Name3050WKey6Name50100WKey7Name100WKey8EduListNameKey0NameKey1NameKey2NameKey3NameKey4NameKey5NameKey6NameKey7StuListNameKey0NameKey1NameKey2(),
    };
  }

  /// `dart:convert`
  ///
  /// Parses the string and returns the resulting Json object as [UserConfig].
  factory UserConfig.fromJson(String data) {
    return UserConfig
        .fromCode1DataSexListNameKey0NameKey1NameKey2MarryListNameKey0NameKey1WorkListNameKey0NameKey1NameKey2NameKey3NameKey4NameKey5NameKey6NameKey7NameKey8NameKey9NameKey10NameKey11NameKey12NameKey13NameKey14NameKey15NameKey16NameKey17NameKey18NameKey19NameKey20NameKey21NameKey22NameKey23NameKey24NameKey25NameKey26NameKey27NameKey28ProfessionListNameKey0NameKey1NameItKey2NameKey3NameKey4NameKey5NameKey6NameKey7NameKey8NameKey9NameKey10NameKey11NameKey12NameKey13NameKey14NameKey15NameKey16NameKey17NameKey18NameKey19NameKey20NameKey21NameKey22NameKey23NameKey24NameKey25NameKey26NameKey27MoneyListNameKey0Name03WKey1Name46WKey2Name710WKey3Name1020WKey4Name2030WKey5Name3050WKey6Name50100WKey7Name100WKey8EduListNameKey0NameKey1NameKey2NameKey3NameKey4NameKey5NameKey6NameKey7StuListNameKey0NameKey1NameKey2(
            json.decode(data) as Map<String, dynamic>);
  }

  /// `dart:convert`
  ///
  /// Converts [UserConfig] to a JSON string.
  String toJson() => json.encode(
      toCode1DataSexListNameKey0NameKey1NameKey2MarryListNameKey0NameKey1WorkListNameKey0NameKey1NameKey2NameKey3NameKey4NameKey5NameKey6NameKey7NameKey8NameKey9NameKey10NameKey11NameKey12NameKey13NameKey14NameKey15NameKey16NameKey17NameKey18NameKey19NameKey20NameKey21NameKey22NameKey23NameKey24NameKey25NameKey26NameKey27NameKey28ProfessionListNameKey0NameKey1NameItKey2NameKey3NameKey4NameKey5NameKey6NameKey7NameKey8NameKey9NameKey10NameKey11NameKey12NameKey13NameKey14NameKey15NameKey16NameKey17NameKey18NameKey19NameKey20NameKey21NameKey22NameKey23NameKey24NameKey25NameKey26NameKey27MoneyListNameKey0Name03WKey1Name46WKey2Name710WKey3Name1020WKey4Name2030WKey5Name3050WKey6Name50100WKey7Name100WKey8EduListNameKey0NameKey1NameKey2NameKey3NameKey4NameKey5NameKey6NameKey7StuListNameKey0NameKey1NameKey2());
}

/// 地区数据
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///

class Area {
  Area({
    this.code,
    this.listArea,
  });

  factory Area.fromJson(Map<String, dynamic> jsonRes) {
    final List<ListArea>? listArea =
        jsonRes['list_area'] is List ? <ListArea>[] : null;
    if (listArea != null) {
      for (final dynamic item in jsonRes['list_area']!) {
        if (item != null) {
          listArea.add(ListArea.fromJson(asT<Map<String, dynamic>>(item)!));
        }
      }
    }
    return Area(
      code: asT<int?>(jsonRes['code']),
      listArea: listArea,
    );
  }

  int? code;
  List<ListArea>? listArea;

  @override
  String toString() {
    return jsonEncode(this);
  }

  Map<String, dynamic> toJson() => <String, dynamic>{
        'code': code,
        'list_area': listArea,
      };
}

class ListArea {
  ListArea({
    this.id,
    this.name,
    this.pid,
    this.childrenArea,
  });

  factory ListArea.fromJson(Map<String, dynamic> jsonRes) {
    final List<ChildrenArea>? childrenArea =
        jsonRes['children_area'] is List ? <ChildrenArea>[] : null;
    if (childrenArea != null) {
      for (final dynamic item in jsonRes['children_area']!) {
        if (item != null) {
          childrenArea
              .add(ChildrenArea.fromJson(asT<Map<String, dynamic>>(item)!));
        }
      }
    }
    return ListArea(
      id: asT<String?>(jsonRes['id']),
      name: asT<String?>(jsonRes['name']),
      pid: asT<String?>(jsonRes['pid']),
      childrenArea: childrenArea,
    );
  }

  String? id;
  String? name;
  String? pid;
  List<ChildrenArea>? childrenArea;

  @override
  String toString() {
    return jsonEncode(this);
  }

  Map<String, dynamic> toJson() => <String, dynamic>{
        'id': id,
        'name': name,
        'pid': pid,
        'children_area': childrenArea,
      };
}

class ChildrenArea {
  ChildrenArea({
    this.id,
    this.name,
    this.pid,
  });

  factory ChildrenArea.fromJson(Map<String, dynamic> jsonRes) => ChildrenArea(
        id: asT<String?>(jsonRes['id']),
        name: asT<String?>(jsonRes['name']),
        pid: asT<String?>(jsonRes['pid']),
      );

  String? id;
  String? name;
  String? pid;

  @override
  String toString() {
    return jsonEncode(this);
  }

  Map<String, dynamic> toJson() => <String, dynamic>{
        'id': id,
        'name': name,
        'pid': pid,
      };
}
